package com.demo.crm.springboot3security.service;

import java.util.List;

import com.demo.crm.springboot3security.entity.FormField;
import com.mybatisflex.core.paginate.Page;

public interface FormFieldService {
    List<FormField> saveAll(List<FormField> fields);

    FormField save(FormField field);

    void delete(Long id);

    FormField findById(Long id);

    List<FormField> findByFormId(Long formId);

    FormField findByNameAndFormId(String name, Long formId);

    List<FormField> findByFormIdOrderByDisplayOrder(Long formId);

    List<FormField> findAll();

    Page<FormField> findByPage(int pageNumber, int pageSize);

    void updateDisplayOrder(Long fieldId, Integer displayOrder);

    void batchUpdateDisplayOrder(List<FormField> fields);

    boolean existsByNameAndFormId(String name, Long formId);

    void deleteByFormId(Long formId);
}